<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2014/6/13
  Time: 17:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>google搜索</title>
    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.css">
    <script type="text/javascript" src="/js/bootbox.min.js"></script>
    <script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script>
</head>
<body>
<div class="container">
<img src="https://s3-ap-southeast-2.amazonaws.com/google6/logo11ws.png" class="img-rounded center-block">
<form action="/google/ipSearch.post" onkeydown="if(event.keyCode==13) return sub();">
<input class="form-control input-lg" type="text" id="value">
</form>
</div>
<button id="submit" type="button" class="btn btn-success btn-lg" style="margin-left:989px ;margin-top: 10;" onclick="sub()">搜索</button>
<div class="alert alert-success" style="margin-top: 50;margin-left: 300px;width: 500px;">
    <h3>动态选取权重最高IP</h3>
    <p>1.以后会增加用户自己录入IP功能。方便大家分享，提高IP质量</p>
    <p>2.有建议或问题可以去<a href="http://www.ro0tsh3ll.com/dwqa-ask-question">这里</a>提出</p>
</div>
</body>
<script>
    function sub() {
        $.ajax({
            type: "post",
            url: "ipSearch.post",
            data: {
                val:$("#value").val()
            },
            dataType : "json",
            success: function(data){
                var a = $("<a href='"+data.final+"' target='_parent'>Apple</a>").get(0);
                var e = document.createEvent('MouseEvents');
                e.initEvent( 'click', true, true );
                a.dispatchEvent(e);
            },
            error: function(){

            }
        });
        return false;
    }


</script>
</html>
